home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18565 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.0 KB  |  70 lines

  1. Path: news.ruhr-uni-bochum.de!usenet
  2. From: Karsten Soete <Karsten.Soete@rz.ruhr-uni-bochum.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: linker error Borland C++ 4.0 for windows
  5. Date: 21 Apr 1996 16:33:49 GMT
  6. Organization: Ruhr-Universitaet Bochum, Rechenzentrum
  7. Message-ID: <4ldo1d$6e7@sun168.rz.ruhr-uni-bochum.de>
  8. NNTP-Posting-Host: dialslip-31.rz.ruhr-uni-bochum.de
  9.  
  10. timmo@compute.tfh-berlin.de (Timmo Koehler (s600186)) schreibt:
  11. > Everytime linking a program we get the following errors:
  12. > C
  13. > 1. linker warning: no module definition file specified: using defaults
  14. > 2. linker error: undefined symbol OwlMain(int,char far*far*) in
  15. >    library file owlwi.lib in module WINMAIN
  16. > Anyone knows help ?!      Thanx in advance !
  17.  
  18. Your first question:
  19. The module-definition file ended by .DEF describes the basic
  20. properties of your application. You must provide your project
  21. with one to prevent the warning. An example is placed in the
  22. lib-directory of BC ++.
  23.  
  24. Your second question:
  25. Like in normal C(++)-programs the main-function or in standard-
  26. windows-programs the WINMAIN-function, the OwlMain is the
  27. entrance-location for your application. Because the OWL bases on
  28. Windows anywhere in your program must be a call to WINMAIN.
  29. But WINMAIN will be linked to your application automatically
  30. by the OWLxx.LIB. WINMAIN then makes a call to OwlMain, which
  31. you have to implement for your own.
  32.  
  33. Here the code for a short "Hello World":
  34. It's some kind of minimal code, for a working app.
  35. #include <owl\applicat.h>
  36. #include <owl\framewin.h>
  37.  
  38. class TMApp:public TApplication{
  39.   public:
  40.     TMApp(const char *name=0):TApplication(name){}
  41.  
  42.     void InitMainWindow();
  43. };
  44.  
  45. void TMApp::InitMainWindow(){
  46.   SetMainWindow(new TFrameWindow(0,"Hello World!"));
  47. }
  48.  
  49. int OwlMain(int,char *[]){
  50.   return TMApp().Run();
  51. }
  52.  
  53. where TMApp is the name of your application-class derived from
  54. TApplication.
  55.  
  56. The module-definition-file should look at follows:
  57. EXETYPE WINDOWS
  58.  
  59. CODE MOVEABLE
  60. DATA MOVEABLE MULTIPLE
  61.  
  62. STACKSIZE 8192
  63. HEAPSIZE  4096
  64.  
  65.